<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" href="css/style.css">
</head>

<body>
    <div class="wrap">
        <ul class="list">
            <li class="item"><img src="/img/1.jpg" alt="#"></li>
            <li class="item"><img src="/img/2.jpg" alt="#"></li>
            <li class="item"><img src="/img/3.jpg" alt="#"></li>
            <li class="item"><img src="/img/4.jpg" alt="#"></li>
            <li class="item"><img src="/img/15jpg" alt="#"></li>
        </ul>
        <ul class="pointList">
            <li class="point" data-index="0"></li>
            <li class="point" data-index="1"></li>
            <li class="point" data-index="2"></li>
            <li class="point" data-index="3"></li>
            <li class="point" data-index="4"></li>
        </ul>
        <button type="button" class="btn" id="goPre">&#60</button>
        <button type="button" class="btn" id="goNext">&#62</button>
    </div>
    <script type="text/javascript">
        var $imgs=$("img");
        var $points=$("point");
        var $goPreBtn=$("#goPre");
        var $goNextBtn=$("#goNext");

        var index=0;
        var length=$imgs.length;

        var timer=setInterval(change,2000);
         
        $wrap.mouseenter(function(){
            clearInterval(timer);
        })
        $wrap.mouseleave(function(){
            clearInterval(timer);
            timer=setInterval(change,2000);
        })
        $goPre.click(change);
        function change(){
            if($imgs,is("animated")){
                return ;
            }
            $imgs.eq(index).fadeOut(600);
            index++;
            if(index>lenght-1){
                index=0;
            }
            $imgs.eq(index).fadeIn(600);
            $points.eq(index).addClass()
        }
    </script>
</body>
</html>